package week7;

import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

public class Main42{
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int x=0;
        String str;
        Set<String> strsetree=new TreeSet<String>();
        for(int i=0;;i++){
            str=in.next();
            if(str.equals("!!!!!")) break;
            else strsetree.add(str);
        }
        System.out.println(strsetree.size());
        for(String s:strsetree){
            x=x+1;
            System.out.println(s);
            if(x==10) break;
        }
    }
}